var MarkedRows = new Array;

function BrowseRowHint(RowObj, Action, RowNo)
{
    var CurrentRow = null;

    if (typeof(document.getElementsByTagName) != 'undefined')
        CurrentRow = RowObj.getElementsByTagName('td');
    else if (typeof(RowObj.cells) != 'undefined')
        CurrentRow = RowObj.cells;
    else
        return false;

    var CurClassName = CurrentRow[0].className;

    CurClassName = CurClassName.toLowerCase();

    var RowMarked = false;

    if (typeof(RowNo) != 'undefined' && typeof(MarkedRows[RowNo]) != 'undefined' && MarkedRows[RowNo])
        RowMarked = true;
    if (typeof(RowNo) == 'undefined')
        RowNo = -1;

    if (CurClassName == '' || CurClassName == 'row_out')
    {
        if (Action == 'over')
            NewClassName = 'row_over';
        else if (Action == 'checked' && RowNo >= 0)
        {
            NewClassName = 'row_select';
            MarkedRows[RowNo] = true;
        }
    }
    else if (CurClassName == 'row_over')
    {
        if (Action == 'out')
        {
            if (RowMarked)
                NewClassName = 'row_select';
            else
                NewClassName = 'row_out';
        }
        else if (Action == 'checked' && RowNo >= 0)
        {
            NewClassName = 'row_select';
            MarkedRows[RowNo] = true;
        }
        else if (Action == 'unchecked' && RowNo >= 0)
        {
            NewClassName = 'row_over';
            MarkedRows[RowNo] = false;
        }
        else if (Action == 'unchecked_out' && RowNo >= 0)
        {
            NewClassName = 'row_out';
            MarkedRows[RowNo] = false;
        }
    }
    else if (CurClassName == 'row_select')
    {
        if (Action == 'over')
            NewClassName = 'row_over';
        else if (Action == 'unchecked' && RowNo >= 0)
        {
            NewClassName = 'row_over';
            MarkedRows[RowNo] = false;
        }
        else if (Action == 'unchecked_out' && RowNo >= 0)
        {
            NewClassName = 'row_out';
            MarkedRows[RowNo] = false;
        }
    }

    if (NewClassName)
    {
        var c = null;

        for (c = 0; c < CurrentRow.length; c++)
            CurrentRow[c].className = NewClassName;
    }

    return true;
}
